<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class ActivityDetail extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('activity_detail', function (Blueprint $table) {
            $table->increments('activity_detail_id');
            $table->mediumInteger('activity_id')->unique();
            $table->integer('item_id');
            $table->string('item_name',255);
            $table->integer('store_id');
            $table->string('store_name');
            $table->enum('activity_detail_state',array(0,1,2,3))->default(0);
            $table->integer('activity_detail_sort')->default(255);
            $table->index('activity_id','activity_detail');

        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('activity_detail');
    }
}
